<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>元素配置 </title>
    <script type="text/javascript" src="/core/file.js"></script>
    <script type="text/javascript" src="/js/sys/user/list.js"></script>
</head>


<body>
<div id="app" class="box">

    <avue-crud
            ref="crud"
            :page="page"
            v-model="form"
            :data="tableData"
            :table-loading="tableLoading"
            :table-loading="tableLoading"
            :option="tableOption"
            @on-load="getList2"
            @search-change="searchChange2"
            @refresh-change="refreshChange2"
            @size-change="sizeChange2"
            @current-change="currentChange2"
            @row-save="handleSave2"
                    @row-update="handleUpdate2"
                    @row-del="rowDel2">
        <template slot="menu" slot-scope="scope">

        </template>

    </avue-crud>

</div>
</body>

<script>
    var vm = new createVue({
        created() {
            this.init();
        },
        el: '#app',
        form: {},
        page1: {
            currentPage: 1,
            total: 0,
            layout: "total,pager,prev, next",
            background: false,
            pageSize: 10
        },
        data: {
            //访问接口前缀
            url: "sys-" + window.location.search.substring(4, 999),
        },
        methods: {

            handleRowClick(row, event, column) {
                row.$cellEdit = true
            },

            //初始化
            init() {
                var newoption = this.tableOption;
                $.ajax({
                    type: "GET",
                    url: "http://"+window.location.host+"/SqlInit/getTemplate/sys_attribute",
                    dataType: "json",
                    success: function (data) {
                        newoption.column = []
                        for (let i = 0; i < data.column.length; i++) {
                            newoption.column.push(data.column[i]);
                        }


                    }
                })

            }
        }
    })
</script>
</html>